babl: add decrease of bits per components to bad_idea()
authorØyvind Kolås <pippin@gimp.org>
Mon, 25 Sep 2017 18:56:55 +0000 (20:56 +0200)
committerØyvind Kolås <pippin@gimp.org>
Mon, 25 Sep 2017 18:56:59 +0000 (20:56 +0200)
related to bug #787441

babl/babl-fish-path.c

index b7133afc6355fbc7a4e241713805b3d51f0fb794..6b2874bd2a88d1beeb4a459bb6fe842e392fb48a 100644 (file)
@@ -165,6 +165,13 @@ bad_idea (const Babl *from, const Babl *to, const Babl *format)
   {
     return 1;
   }
+  if (from->format.type[0]->bits > format->format.type[0]->bits)
+  {
+    /* XXX: perhaps we especially avoid going to half-float, when
+     * going between u16 formats as well? */
+    return 1;
+  }
+
   return 0;
 }